package co.yixiang.yshop.module.product.controller.admin.storeproductstockwarning;

import co.yixiang.yshop.framework.common.pojo.CommonResult;
import co.yixiang.yshop.framework.common.pojo.PageResult;
import co.yixiang.yshop.module.product.controller.admin.storeproductstockwarning.vo.StoreProductStockWarningCreateReqVO;
import co.yixiang.yshop.module.product.controller.admin.storeproductstockwarning.vo.StoreProductStockWarningPageReqVO;
import co.yixiang.yshop.module.product.controller.admin.storeproductstockwarning.vo.StoreProductStockWarningRespVO;
import co.yixiang.yshop.module.product.controller.admin.storeproductstockwarning.vo.StoreProductStockWarningUpdateReqVO;
import co.yixiang.yshop.module.product.convert.storeproductstockwarning.StoreProductStockWarningConvert;
import co.yixiang.yshop.module.product.dal.dataobject.storeproductstockwarning.StoreProductStockWarningDO;
import co.yixiang.yshop.module.product.service.storeproductstockwarning.StoreProductStockWarningService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import javax.validation.Valid;
import java.util.Collection;
import java.util.List;

import static co.yixiang.yshop.framework.common.pojo.CommonResult.success;

@Tag(name = "管理后台 - 商品库存预警")
@RestController
@RequestMapping("/product/store-product-stock-warning")
@Validated
public class StoreProductStockWarningController {

    @Resource
    private StoreProductStockWarningService storeProductStockWarningService;



    @GetMapping("/page")
    @Operation(summary = "获得商品库存预警分页")
    @PreAuthorize("@ss.hasPermission('product:store-product-stock-warning:query')")
    public CommonResult<PageResult<StoreProductStockWarningRespVO>> getStoreProductStockWarningPage(@Valid StoreProductStockWarningPageReqVO pageVO) {
        return success(storeProductStockWarningService.getStoreProductStockWarningPage(pageVO));
    }



}
